package test;



public class test2 {
	
	public static void main(String[] args) {
		int min=1;
		int max=20000;
		int count=0;
		
		for(int i=min;i<max;i++)
		{
			if(isPrime(i))
			{
				count++;
				System.out.print(i + "\t");
				if (count % 5 == 0)
					System.out.println();
			}
		}
	}
	  
	 public static boolean isPrime(int number) {
		 boolean flag=true;
		 if(number<2) {
			 flag=false;
		 }
		 else if(number==2)
		 {
			 flag=true;
		 }
		 else {
			 for(int i=2;i<=Math.sqrt(number);i++)
			 {
				 if(number%i==0)
				 {
					 flag=false;
					 break;
				 }
			 }
		 }
		 return flag;
	 }
	 

}
